import request from "./request.js"


/**
 * 商品列表
 */
export function getGoodsPage(data) {
	return request({
		url: '/business/api/clientGoodsSpu/findPage',
		method: 'POST',
		data
	})
}
/**
 * 商品详情
 */
export function getGoodsDetail(spuId) {
	return request({
		url: '/business/api/clientGoodsSpu/detail',
		method: 'GET',
		data: {
			spuId
		}
	})
}

/**
 * 商品分类一级
 */
export function getCategoryList(data) {
	return request({
		url: '/business/api/clientGoodsCategory/findList',
		method: 'GET',
		data
	})
}

/**
 * 商品下单
 */
export function exchangeOrder(data) {
	return request({
		url: '/business/api/clientUserGoodsExchange/exchangeOrder',
		method: 'POST',
		data
	})
}

/**
 * 商品兑换记录列表
 */
export function getExchangeRecord(data) {
	return request({
		url: '/business/api/clientUserGoodsExchange/exchangeRecord',
		method: 'GET',
		data
	})
}
/**
 * 商品兑换记录详情
 */
export function getExchangeRecordDetail(exchangeGoodsId) {
	return request({
		url: '/business/api/clientUserGoodsExchange/exchangeRecordDetail',
		method: 'GET',
		data: {
			exchangeGoodsId
		}
	})
}
/**
 * 取消兑换
 */
export function goodsCancelExchangeOrder(exchangeGoodsId) {
	return request({
		url: '/business/api/clientUserGoodsExchange/cancelExchangeOrder',
		method: 'POST',
		data: {
			exchangeGoodsId
		}
	})
}

/**
 * 确认收货/自提
 */
export function goodsConfirmReceipt(exchangeGoodsId) {
	return request({
		url: '/business/api/clientUserGoodsExchange/confirmReceipt',
		method: 'POST',
		data: {
			exchangeGoodsId
		}
	})
}
